export default function (date:Date) {
    const addZero = (n:number) => {
        if (n < 10) {
            return '0' + n
        } else {
            return n;
        }
    }
    let date_ = new Date(date);
    let y = date_.getFullYear();
    let m = date_.getMonth()+1;
    let d = date_.getDate();
    return `${addZero(y)}-${addZero(m)}-${addZero(d)}`
}